package com.zy.qudadid.ui.widget;

import android.app.Dialog;
import android.content.Context;
import android.view.Window;
import android.widget.TextView;

import com.zy.lcpassenger.R;


/**
 * @author  lc 
 * @date 创建时间：2016-4-25 下午4:47:12 
 * @version 1.0 
 * @Description
 */
public class OneButtonImgDialog {
    Context context;
    Dialog  ad;

    public TextView txt_queding;
    public TextView txt_content;

    public OneButtonImgDialog(Context context) {
        // TODO Auto-generated constructor stub
        this.context=context;
//        ad=new Dialog.Builder(context).create();
        ad = new Dialog(context);
        ad.requestWindowFeature(Window.FEATURE_NO_TITLE);
        ad.show();
        //关键在下面的两行,使用window.setContentView,替换整个对话框窗口的布局
        Window window = ad.getWindow();
        window.setContentView(R.layout.dialog_onebutton_img);
        window.setBackgroundDrawableResource(R.drawable.border_white_4dp);
        ad.setCancelable(true);
        
        txt_queding = (TextView) window.findViewById(R.id.dialog_notic_confirm);
        txt_content = (TextView) window.findViewById(R.id.dialog_notic_text);

    }

    public void setText(String str){
        txt_content.setText(str);
    }


    public void setConfirmText(String str){
        txt_queding.setText(str);
    }
    
    /**
     * 关闭对话框
     */
    public void dismiss() {
        ad.dismiss();
    } 
    
    
}
